package com.test.first;

import androidx.appcompat.app.AppCompatActivity;


import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import java.math.BigDecimal;

public class Main2Activity extends AppCompatActivity {

    private static final String TAG="Main2Activity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
        TextView show=findViewById(R.id.show);

    }



    public void open(View btn){

       Log.i(TAG,"open:open main3.........");
        Intent main3 = new Intent(this,Main3Activity.class);
        startActivity(main3);

//        Intent intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:87092173"));
//        startActivity(intent);
//
//
//        Intent jdintent = new Intent(Intent.ACTION_VIEW,Uri.parse("http://www.jd.com"));
//        startActivity(jdintent);



    }
    public void openmain5(View btn){

        Log.i(TAG,"open:open main5.........");
        Intent main5 = new Intent(this,Main5Activity.class);
        startActivity(main5);
    }

    public void OnClick(View v){
        try {
            EditText inp=findViewById(R.id.inpute);
            String str = inp.getText().toString();
            TextView OutPut = findViewById(R.id.OutPut);

               Double Tem =Double.parseDouble(str);
               Double Tem1 =Tem*1.8+32;
            BigDecimal b =new BigDecimal(Tem1);
            Tem1 = b.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
            OutPut.setText("华氏度为："+Tem1+"F");

        }
        catch(Exception e){
            TextView OutPut = findViewById(R.id.OutPut);
            OutPut.setText("请输入数字");
        }
    }











}